import { Column, Entity, ManyToOne } from 'typeorm';
import { DBColumns } from '../';
import { ProcessFilesSchema, UserSchema } from '../../schema';
import { User } from '../user/user';

@Entity('process_files')
export class ProcessFiles extends DBColumns implements ProcessFilesSchema {
  @Column({
    type: 'varchar',
    length: 50,
    nullable: false,
    default: null,
    comment: '处理后的文件路径',
  })
  path: string;

  @Column({
    type: 'varchar',
    length: 50,
    nullable: false,
    default: null,
    comment: '处理耗时',
  })
  diffTime: string;

  @ManyToOne(() => User, user => user.mergePdfs)
  user: UserSchema;
}
